import { createApp } from 'vue'
import { createPinia } from 'pinia';
import App from './App.vue'
import router from './router';
const app = createApp(App)
const pinia = createPinia();
app.use(pinia);
app.use(router);
app.mount('#app')


/**
function piniaPersist({store}){
    if(store.$id !== 'cart'){
        return;
    }
    let cartStateStr = localStorage.getItem('cart');
    if(cartStateStr){
        store.cartItems=JSON.parse(cartStateStr).cartItems;
    }
    store.$subscribe((_,state)=>{
        localStorage.setItem('cart',JSON.stringify(state));
    });
}
pinia.use(piniaPersist);
 */